layui.use(function () {
    var $ = layui.jquery;
    $.ajaxSetup({
        type: 'post',
        timeout: 30000,
        cache: false,
        beforeSend: function () {
            //if (this.url.indexOf('Home') < 0) {
            layer.load(0);
            //}
        },
        error: function (xhr) {
            console.log(xhr);;
        },
        complete: function () {
            //if (this.url.indexOf('Home') < 0) {
            layer.closeAll("loading");
            //}
        }
    });

    //获取url中的参数
    layui.getUrlParam = function (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
});